Repository navigation
feat(scout-for-lol): add hero, duel hero, face, strip, bar and rank lockup components - #5245
Conversation
|
This change is part of the following stack: Change managed by git-spice. |
|
Automatic reviews are disabled for this repository. Configure in Code Review Settings. |
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
6e4ccf0 to
bd591aa
Compare
2181e70 to
4f6c645
Compare
|
@codex review Automated re-review request for |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2d2db3ccba
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| .scout-result-strip__dot { | ||
| flex: none; | ||
| width: 19px; | ||
| height: 19px; |
There was a problem hiding this comment.
Let result dots shrink within narrow desktop containers
At viewport widths above 720px, the new NarrowColumn story constrains the strip to 20rem (320px), but its 20 non-shrinking 19px dots require over 450px once gaps are included, and the streak wrapper adds more space. The strip therefore overflows its panel instead of fitting the column. The responsive override only considers viewport width, so it cannot handle narrow columns on desktop. Allow the dots and streak to shrink based on the available container width.
Useful? React with 👍 / 👎.
…ockup components Why The redesigned pages share a handful of domain pieces: a lead panel with a champion fading in, a matchup lead with two champions, round faces for champions and people, the last-games strip, a win-rate bar and a rank lockup. They belong in the design system, built once on the soft surface primitives. What - `domain/profile/`: `HeroPanel` (art, `align`, an `action` slot, works with no art) and `DuelHero`; `ChampionFace` (sizes 26 to 92, win/loss mark) and `PersonInitial` (sizes, `you`, live dot, champion badge); `ResultStrip` (oldest to newest, hollow loss rings, soft current-streak highlight, accessible summary); `WinRateBar` (a filled bar, or a dot on a track with an optional 50% mark and likely range); `RankLockup`. - Art takes `face` (the way the champion in the source art looks) and a `mirrored` override, so a later facing file can flip the art toward the words without touching call sites. No facing data exists yet; art is shown as it is until `face` is given. - `RankDisplay` gains `size` and `detail`; `RankLockup` wraps it. - `styles/friendly-domain.css` carries the rules, values from d9, d10 and d11 CSS, plus a `--scout-loss-soft` variable beside `--scout-win-soft`. - A story per component with real champion art, long names, empty and no-art cases; the catalog test runs them in its three themes. - `text-scout-warning` was used by the app but never mapped, so it rendered as inherited text. Mapping it to the fill would be 2.3:1 (modern) and 3.6:1 (classic) on the dark themes, so this adds a `warningOnSurface` token to all four themes (light: the existing value; dark: #E0A24F and #D9A04F, at least 6:1 on every ground), the schema and the generator, and maps `scout-warning` to it in the app. A test holds the contrast. Verification - bunx turbo run build typecheck test lint --filter=@scout-for-lol/design-system --filter=@scout-for-lol/app --filter=@scout-for-lol/frontend --filter=@scout-for-lol/design-audit. - bun run test:e2e in the design-system package: every new story in modern dark, modern light and classic light with axe. - Stories rendered and inspected in modern dark and light at 1440 and 390. - Extended tier: none of the touched packages has extended steps. - Not run: live deployment; no page uses these components yet. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011u9pQk6p4o3DxofkiZXg8y
…one line in rows Why Review of the new domain components found two problems at 390 wide: the duel hero's two art halves met in a bright vertical band with the heading sitting over the bottom of the art, and a long name in a win-rate row wrapped to four lines. What - Narrow duel hero: the two champions overlap by a tenth and the end one fades in across the overlap, so the halves blend into each other and never into the panel colour. One fade into the panel runs across both, which gives the heading a clean ground. Stacking a fade on each half had left a seam at the first half's edge. - Narrow hero panel: its rules lost on specificity to the desktop side rules, so the art was offset inside its box and carried a horizontal mask. They now match the desktop specificity. - `NameText`: one line with an ellipsis, the whole name kept as text and in `title`. The win-rate ranking, faces in a feed and people beside names stories use it, with narrow and long-name variants. Verification - bun run test:e2e in the design-system package: 879 passed, every story in modern dark, modern light and classic light with axe. - 83 design-system unit tests pass, including NameText. - eslint, tsc and prettier clean for the touched files. - Stories re-captured at 390 and 1440 in modern dark and light. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011u9pQk6p4o3DxofkiZXg8y
2d2db3c to
d18276f
Compare
Stacked on #5209 (primitives) and #5208 (variables). Tracker AI-966.
Why
The redesigned pages share a handful of domain pieces: a lead panel with a
champion fading in, a matchup lead with two champions, round faces for
champions and people, the last-games strip, a win-rate bar and a rank lockup.
They belong in the design system, built once on the soft surface primitives and
friendly.cssvariables, before any page composes them.What
All in
design-system/src/domain/profile/(the flatdomain/directory is atthe repository's file budget), exported through the existing
./domain/*map.HeroPanel: words on one side, champion splash fading in from the other(
align="start" | "end"), anactionslot floating over the art, works withno art.
DuelHero: two champions facing each other around a centred verdict.Both sit on
Panel variant="hero"and render as asection, so a callernames the landmark with
aria-labelledby.art.faceis the direction the champion in the source art looks(
"left" | "right") andart.mirroredis an explicit override. Art isflipped when it looks away from the words. No facing data exists yet, so art
without
faceis shown as it is; a later facing file only has to supplyface.ChampionFace(sizes 26, 36, 40, 46, 76, 92; win or loss mark with text forassistive technology) and
PersonInitial(sizes s, m, l;you; live dot;champion badge). The initial is the first letter or digit of the name, with
a grapheme fallback.
ResultStrip: oldest to newest, wins filled, losses hollow rings in the losscolour, the current streak (two or more) on a soft tint, an accessible text
summary, empty slots at the old end, and only the newest
slotskept.WinRateBar:bar(filled track, value, optional 50% mark,youtint) andrange(dot on a track, optional 50% "even" label and likely range). Itthrows on a value outside 0 to 100 or a backwards range.
RankLockupwrapsRankDisplay, which gainssizeanddetail.NameText: a name in a row, one line with an ellipsis, the whole name keptas text and in
title, so rows keep one height. The stories' rows (win-rateranking, faces in a feed, people beside names) use it.
end one fading in across the overlap so the halves blend into each other,
and one fade into the panel runs across both, leaving the heading a clean
ground (stacking a fade on each half left a seam at the first half's edge).
The hero panel's narrow rules had lost on specificity to the desktop side
rules, so its art was offset inside its box; they now win.
styles/friendly-domain.css, with--scout-loss-softnext to--scout-win-softinfriendly.css. Values come from d9, d10 and d11 CSS.and mirrored cases; the catalog test mounts all of them in modern dark,
modern light and classic light.
text-scout-warningIt was genuinely undefined in the app's Tailwind theme (used in
dare-progress.tsxanddare-list.tsx), so it rendered as inherited text.Mapping it to the
warningfill would have been a regression rather than aone-line fix: the fill is 2.3:1 on the modern dark surface and 3.6:1 on the
classic dark one. So this adds a
warningOnSurfacetoken (as success and danger alreadyhave): the existing value on the two light themes and
#E0A24F/#D9A04Fonthe dark ones (at least 6:1 on every ground), in
themes.json, the schema, thegenerator and the generated files, and maps
scout-warningto it in the app.The built app CSS now contains
.text-scout-warning{color:var(--scout-color-warning-on-surface)}. The frontendstill maps
scout-warningto the fill, as it does for the colours A1 leftalone; it is not touched here.
Demo
Review fixes (before and after)
All stories
New components, so there is no prior state. Rendered from the Storybook build,
modern dark and light.
Heroes
Faces, people, strip, bars, rank
Verification
bunx turbo run build typecheck test lint --filter=@scout-for-lol/design-system --filter=@scout-for-lol/app --filter=@scout-for-lol/frontend --filter=@scout-for-lol/design-audit: 41 of 41 tasks successful.bun run test:e2einpackages/scout-for-lol/packages/design-system: 879 passed (after the review fixes), every story (the new ones included) in modern dark, modern light and classic light with the page-error, broken-image and axe checks.src/domain/profile/profile.test.tsx(28 tests: streak and summary, padding and truncation, percent formatting and track positions, range and bar markup, loud failure on bad input, initials, face marks, facing and mirroring, hero and duel markup, rank lockup, NameText) and additions tofriendly-styles.test.ts(loss tint, warning contrast in all four themes, the app mapping).launchctl bootstrap("Input/output error") while other agents were running. They are the same pages the catalog test mounts.🤖 Generated with Claude Code
https://claude.ai/code/session_011u9pQk6p4o3DxofkiZXg8y